]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Make the section invisible if it has no visible children
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 26 Aug 2013 19:21:45 +0000 (15:21 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 29 Aug 2013 19:17:12 +0000 (15:17 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=706852

js/ui/popupMenu.js

index e720c672084f8f3af899b0b5d425780490ac294f..1fe78f74cc3b2b1b4c2fff5c95ba55e6b4dc9f7f 100644 (file)
@@ -921,10 +921,19 @@ const PopupMenuSection = new Lang.Class({
         this.isOpen = true;
     },
 
+    _syncVisibility: function() {
+        this.actor.visible = !this.isEmpty();
+    },
+
     // deliberately ignore any attempt to open() or close(), but emit the
     // corresponding signal so children can still pick it up
-    open: function() { this.emit('open-state-changed', true); },
-    close: function() { this.emit('open-state-changed', false); },
+    open: function() {
+        this._syncVisibility();
+        this.emit('open-state-changed', true);
+    },
+    close: function() {
+        this.emit('open-state-changed', false);
+    },
 });
 
 const PopupSubMenuMenuItem = new Lang.Class({